import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  static final hehe = "完美";
  Widget build(BuildContext context) {
    var map = new Map();
    map["hehe"] = "世界";
    return new MaterialApp(
      title: 'Welcome to Flutter',
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('标题'),
          
        ),
        body: new Center(
          //child: new Text("123"+hehe+ a.toDouble().toString()+map["hehe"]),
          child: HomeContent(),
        ),
      ),
    );
  }
}



//自定义组件
class HomeContent extends StatelessWidget {
  //自定义方法
  Widget getListData(content,index){
    return ListTile(
      title:Text("标题$index"),
      onTap:(){
        print(index);
      }
    );
  }
   @override
   Widget build(BuildContext content){
     return ListView.builder(itemCount: 10,itemBuilder: this.getListData);
   }
}
